FROM openjdk:11
LABEL author="kurisu"
LABEL version="1.0"
LABEL maintainer="makise_kurisuu@outlook.jp"
ARG JAR_FILE=/scripts/build/libs/bilibili-task.jar
ARG PORT=8080
ADD ${JAR_FILE} bilibilitask.jar
COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
EXPOSE $PORT
ENV JAVA_OPTS="-Xms128m -Xmx256m -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=96m "
ENV RUN_ARGS="--server.port=${PORT} --server.tomcat.max-threads=100 --server.tomcat.min-spare-threads=20 --server.tomcat.connection-timeout=5000  --server.compression.enabled=true --server.tomcat.uri-encoding=UTF-8"
ENTRYPOINT java ${JAVA_OPTS} -jar bilibilitask.jar ${RUN_ARGS}
